//
//  ViewController.m
//  BHQRCode
//
//  Created by sun binhua on 2017/2/22.
//  Copyright © 2017年 sun binhua. All rights reserved.
//

#import "ViewController.h"
#import "BHQRCodeReaderController.h"

@interface ViewController ()<BHQRCodeReaderDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (IBAction)scan:(id)sender {
    BHQRCodeReaderController *qrCode = [[BHQRCodeReaderController alloc] init];
    qrCode.bh_readerDelegate = self;
    [self presentViewController:qrCode animated:YES completion:nil];
    
}

- (void)bh_readerController:(BHQRCodeReaderController *)readerController getText:(NSString *)string withError:(NSError *)error{
    NSLog(@"%@",string);
    [readerController dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
